package com.poly.oss.pojo.query;


import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;

@Data
public class ItemQuery implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 页码
     */
    private Integer pageNum = 1;

    /**
     * 页数
     */
    private Integer pageSize = 20;

    /**
     * 请求参数
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;


    private String dir;

    private String filename;


    public Integer getOffset() {
        return (Math.max(pageNum, 1) - 1) * pageSize;
    }

}
